<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-JAVA: awtk.TGrid类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-JAVA
   </div>
   <div id="projectbrief">AWTK JAVA API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>awtk</b></li><li class="navelem"><a class="el" href="classawtk_1_1_t_grid.html">TGrid</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="classawtk_1_1_t_grid-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">awtk.TGrid类 参考</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
类 awtk.TGrid 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classawtk_1_1_t_grid.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ab3408292e5a04a2fa09043bc23ae0ede"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#ab3408292e5a04a2fa09043bc23ae0ede">TGrid</a> (long nativeObj)</td></tr>
<tr class="separator:ab3408292e5a04a2fa09043bc23ae0ede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3183600e35012d455d0d7f9c18fb704e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a3183600e35012d455d0d7f9c18fb704e">setRows</a> (int rows)</td></tr>
<tr class="separator:a3183600e35012d455d0d7f9c18fb704e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3b7bb1902f694b8095cb421936cedfd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#ae3b7bb1902f694b8095cb421936cedfd">setColumnsDefinition</a> (String columns_definition)</td></tr>
<tr class="separator:ae3b7bb1902f694b8095cb421936cedfd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac952d2a8589974cf22b179f12f4c8c21"><td class="memItemLeft" align="right" valign="top"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#ac952d2a8589974cf22b179f12f4c8c21">setShowGrid</a> (boolean show_grid)</td></tr>
<tr class="separator:ac952d2a8589974cf22b179f12f4c8c21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f235eddfd8b5afe689755e5697e3776"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a1f235eddfd8b5afe689755e5697e3776">getRows</a> ()</td></tr>
<tr class="separator:a1f235eddfd8b5afe689755e5697e3776"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a569dc6e8969463b803d6570d35e60ef6"><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a569dc6e8969463b803d6570d35e60ef6">getColumnsDefinition</a> ()</td></tr>
<tr class="separator:a569dc6e8969463b803d6570d35e60ef6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab58a1f84cef9ef3ccee1dce8293e1481"><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#ab58a1f84cef9ef3ccee1dce8293e1481">getShowGrid</a> ()</td></tr>
<tr class="separator:ab58a1f84cef9ef3ccee1dce8293e1481"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a37173f6d41f11dc46ab5f2f172bd849f"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_grid.html">TGrid</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a37173f6d41f11dc46ab5f2f172bd849f">cast</a> (long nativeObj)</td></tr>
<tr class="separator:a37173f6d41f11dc46ab5f2f172bd849f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a451b513bd7be7a450f4b07640e799e"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a3a451b513bd7be7a450f4b07640e799e">create</a> (TWidget parent, int x, int y, int w, int h)</td></tr>
<tr class="separator:a3a451b513bd7be7a450f4b07640e799e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a665aac4c78621e502cd2f6deced138c6"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classawtk_1_1_t_grid.html">TGrid</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classawtk_1_1_t_grid.html#a665aac4c78621e502cd2f6deced138c6">cast</a> (TWidget widget)</td></tr>
<tr class="separator:a665aac4c78621e502cd2f6deced138c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>网格。 在xml中使用"grid"标签创建控件。如：</p>
<div class="fragment"><div class="line">*<span class="comment">&lt;!-- ui --&gt;</span></div>
<div class="line">*&lt;<span class="keywordtype">grid</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;c&quot;</span> <span class="keyword">y</span>=<span class="stringliteral">&quot;50&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;100&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;100&quot;</span>/&gt;</div>
</div><!-- fragment --><p>可用通过style来设置控件的显示风格，如字体的大小和颜色等等。如：</p>
<div class="fragment"><div class="line">*<span class="comment">&lt;!-- style --&gt;</span></div>
<div class="line">*&lt;<span class="keywordtype">grid</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">style</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;default&quot;</span> <span class="keyword">grid_color</span>=<span class="stringliteral">&quot;gray&quot;</span> <span class="keyword">border_color</span>=<span class="stringliteral">&quot;black&quot;</span> <span class="keyword">odd_bg_color</span>=<span class="stringliteral">&quot;#f5f5f5&quot;</span> <span class="keyword">even_bg_color</span>=<span class="stringliteral">&quot;#eeeeee&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">normal</span> /&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">style</span>&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">grid</span>&gt;</div>
</div><!-- fragment --> </div><h2 class="groupheader">构造及析构函数说明</h2>
<a id="ab3408292e5a04a2fa09043bc23ae0ede"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab3408292e5a04a2fa09043bc23ae0ede">&#9670;&nbsp;</a></span>TGrid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">awtk.TGrid.TGrid </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>通过nativeObj构造Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a id="a37173f6d41f11dc46ab5f2f172bd849f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37173f6d41f11dc46ab5f2f172bd849f">&#9670;&nbsp;</a></span>cast() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_grid.html">TGrid</a> awtk.TGrid.cast </td>
          <td>(</td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>nativeObj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>把nativeObj转换层Java对象。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">nativeObj</td><td>原生对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的Java对象。 </dd></dl>

</div>
</div>
<a id="a665aac4c78621e502cd2f6deced138c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a665aac4c78621e502cd2f6deced138c6">&#9670;&nbsp;</a></span>cast() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classawtk_1_1_t_grid.html">TGrid</a> awtk.TGrid.cast </td>
          <td>(</td>
          <td class="paramtype">TWidget&#160;</td>
          <td class="paramname"><em>widget</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>转换为grid对象(供脚本语言使用)。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">widget</td><td>grid对象。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>grid对象。 </dd></dl>

</div>
</div>
<a id="a3a451b513bd7be7a450f4b07640e799e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a451b513bd7be7a450f4b07640e799e">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static TWidget awtk.TGrid.create </td>
          <td>(</td>
          <td class="paramtype">TWidget&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建grid对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>grid对象。 </dd></dl>

</div>
</div>
<a id="a569dc6e8969463b803d6570d35e60ef6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a569dc6e8969463b803d6570d35e60ef6">&#9670;&nbsp;</a></span>getColumnsDefinition()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">String awtk.TGrid.getColumnsDefinition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>各列的参数。 各列的参数之间用英文的分号(;)分隔，每列参数的格式为：</p>
<p>col(w=?,left_margin=?,right_margin=?,top_maorgin=?,bottom_margin=?)</p>
<p>w 为列的宽度(必须存在)。取值在(0-1]区间时，视为grid控件宽度的比例，否则为像素宽度。 (如果为负数，将计算结果加上控件的宽度) left_margin(可选，可缩写为l) 该列左边的边距。 right_margin(可选，可缩写为r) 该列右边的边距。 top_margin(可选，可缩写为t) 该列顶部的边距。 bottom_margin(可选，可缩写为b) 该列底部的边距。 margin(可选，可缩写为m) 同时指定上面4个边距。 fill_available(可选，可缩写为f) 填充剩余宽度(只有一列可以指定)。 </p>

</div>
</div>
<a id="a1f235eddfd8b5afe689755e5697e3776"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f235eddfd8b5afe689755e5697e3776">&#9670;&nbsp;</a></span>getRows()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int awtk.TGrid.getRows </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>行数。 </p>

</div>
</div>
<a id="ab58a1f84cef9ef3ccee1dce8293e1481"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab58a1f84cef9ef3ccee1dce8293e1481">&#9670;&nbsp;</a></span>getShowGrid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">boolean awtk.TGrid.getShowGrid </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>是否显示网格。 </p>

</div>
</div>
<a id="ae3b7bb1902f694b8095cb421936cedfd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3b7bb1902f694b8095cb421936cedfd">&#9670;&nbsp;</a></span>setColumnsDefinition()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TGrid.setColumnsDefinition </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>columns_definition</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置 各列的参数。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">columns_definition</td><td>各列的参数。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a3183600e35012d455d0d7f9c18fb704e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3183600e35012d455d0d7f9c18fb704e">&#9670;&nbsp;</a></span>setRows()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TGrid.setRows </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>rows</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置 行数。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">rows</td><td>行数。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="ac952d2a8589974cf22b179f12f4c8c21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac952d2a8589974cf22b179f12f4c8c21">&#9670;&nbsp;</a></span>setShowGrid()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="enumawtk_1_1_t_ret.html">TRet</a> awtk.TGrid.setShowGrid </td>
          <td>(</td>
          <td class="paramtype">boolean&#160;</td>
          <td class="paramname"><em>show_grid</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>设置 是否显示网格。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">show_grid</td><td>是否显示网格。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/TGrid.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
